package org.bigjava.novelplatform.common.exception;

import lombok.Getter;

/**
 * 异常code对应的异常原因
 *
 * @author ykh
 * @create 2022-03-25 9:59
 */
@Getter
public enum ExceptionCodeMessage {
    NOT_BOOK(300,"没有连载的书籍"),
    /**
     *
     */
    UNSUPPORTED_URL(301, "不支持的url"),


    UNSUPPORTED_MAIL(305, "不支持的邮箱"),
    /**
     * 验证码发送失败
     */
    AUTH_CODE_FAIL(306, "验证码发送失败"),

    FIELD_ERROR(307, "字段校验异常"),

    NON_COMPLIANT_PARAMETERS(310, "不合规的参数"),

    UN_LOGIN(400, "用户未未登录"),

    USER_ACTION(401, "用户操作异常"),

    USER_REGISTER(405, "用户注册失败"),

    USER_REST_PASSWORD(406, "用户修改密码失败"),

    USER_LOGIN(407, "用户登录失败"),

    TOKE_INVALID(408, "无效的token"),

    ACTION_FREQUENTLY(409, "操作频繁"),

    USED_EMAIL(410, "已使用的邮箱"),
    /**
     * token和用户信息不一致
     */
    USERINFO_UNFIT(411, "用户信息错误"),

    VERIFICATION_CODE_ERROR(412, "验证码错误"),

    NOT_WRITER(413, "非作者用户无权访问"),

    NOT_ERROR_MESSAGE(413, "邮箱或密码错误"),
    SERIAL_ONLY(414, "一个作者只能有一本连载状态的书籍"),
    UNRECOGNIZED_TYPE(420, "无法识别的类型"),

    ALREADY_EXISTS(421, "已存在"),

    REPETITION_BOOK(450, "不能创建重复的书籍"),

    NONEXISTENT_BOOKS(451, "不存在的书籍"),


    NONEXISTENT_CHAPTER(452, "章节不存在或者该章节已删除"),

    UNKNOWN_ABNORMAL(500, "未知异常,请联系管理员"),

    ILLEGAL_OPERATION(555, "非法操作"),

    SORRY_YOUR_CREDIT_IS_RUNNING_LOW(600,"余额不足")

    ;

    ExceptionCodeMessage(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    /**
     * 异常码
     */
    private final Integer code;
    /**
     * 异常原因
     */
    private final String message;
}
